package com.sunwayhorizo.health.hl7.persistent;

import com.sunwayhorizo.health.hl7.persistent.pk.RimCoreEntyNamePartsPK;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
//@TableGenerator(name = "EntityNameParts_Generator", table = "RIM_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn", pkColumnValue = "Enty_NameParts")
// @NamedQuery(name = "EntyNameParts.findAll", query =
// "select o from EntyNameParts o")
@Table(name = "RIM_CORE_ENTY_NAME_PARTS")
@IdClass(RimCoreEntyNamePartsPK.class)
public class RimCoreEntyNameParts implements Serializable {
	@Id
	@Column(name = "ENTITY_ID", nullable = false, insertable = false, updatable = false)
	private Long entityId;
	@Id
	@Column(name = "ENTITY_VERSION_NUM", nullable = false, insertable = false, updatable = false)
	private Long entityVersionNum;
	@Id
	@Column(name = "ENTITY_NAME_ID", nullable = false, insertable = false, updatable = false)
	private Long entityNameId;
	@Id
//	@GeneratedValue(strategy = GenerationType.TABLE, generator = "EntityNameParts_Generator")
	@Column(name = "ENTITY_NAME_PART_ID", nullable = false)
	private Long entityNamePartId;

	@Column(name = "NAME_PART_TYPE_CODE")
	private String PartType;
	@Column(name = "PART_NAME")
	private String literal;
	@Column(name = "PART_ORDER_NUM")
	private int partOrderNum;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "ENTITY_ID", referencedColumnName = "ENTITY_ID"),
			@JoinColumn(name = "ENTITY_VERSION_NUM", referencedColumnName = "ENTITY_VERSION_NUM"),
			@JoinColumn(name = "ENTITY_NAME_ID", referencedColumnName = "ENTITY_NAME_ID") })
	private RimCoreEntyNames rimCoreEntyNames;

	public RimCoreEntyNameParts() {
	}

	public Long getEntityId() {
		return entityId;
	}

	public void setEntityId(Long entityId) {
		this.entityId = entityId;
	}

	public Long getEntityNameId() {
		return entityNameId;
	}

	public void setEntityNameId(Long entityNameId) {
		this.entityNameId = entityNameId;
	}

	public Long getEntityNamePartId() {
		return entityNamePartId;
	}

	public void setEntityNamePartId(Long entityNamePartId) {
		this.entityNamePartId = entityNamePartId;
	}

	public Long getEntityVersionNum() {
		return entityVersionNum;
	}

	public void setEntityVersionNum(Long entityVersionNum) {
		this.entityVersionNum = entityVersionNum;
	}

	public String getPartType() {
		return PartType;
	}

	public void setPartType(String PartType) {
		this.PartType = PartType;
	}

	public String getLiteral() {
		return literal;
	}

	public void setLiteral(String literal) {
		this.literal = literal;
	}

	public Integer getPartOrderNum() {
		return partOrderNum;
	}

	public void setPartOrderNum(Integer partOrderNum) {
		this.partOrderNum = partOrderNum;
	}

	public void setRimCoreEntyNames(RimCoreEntyNames rimCoreEntyNames) {
		this.rimCoreEntyNames = rimCoreEntyNames;
	}

	public RimCoreEntyNames getRimCoreEntyNames() {
		return rimCoreEntyNames;
	}
}
